#ifndef CONTROLLER_H
#define CONTROLLER_H
#include "api.h"
//#include "uimanager.h"
#include "user.h"
#include <QString>
#include <QObject>
#include "Enums.h"
#include "frm_userpage.h"

#include "usermodel.h"
class UIManager;
class QueryPackage;
class Controller:public QObject
{
Q_OBJECT
public:
    Controller();
    Controller(const Controller&) = delete;
    Controller& operator=(const Controller&) = delete;
    Controller(Controller&&) = delete;
    Controller& operator=(Controller&&) = delete;
    void Start();
    void exitApp();
    void setUIManager(UIManager*);
    QStringList tps;
    QStringList stas;
    QStringList cities;
public slots:
    void LoginDone();
    void RequestForVerify(QString Email);
    void RegisterRequested();
    void EmailVerifierRequested();
    void RequestForQueryModel(QueryPackage*);
    void RequestForRegister();
    void RequestNewUser(User*,QString);
    void RequestForLogin(QString,QString,QString);
    void OrderPageRequested(QueryResult*);
    void QueryModelPageSet(int);
    void SetDefault();
    void UserPageRequested();
    void changeUserData(User t);
    void OrderModelRequest();
    void RequestForUserPage();
    void RequestForUserModel();
    void CheckLogin();
private:
    UserModel* us;
    UIManager* ui;
    QueryResultModel* fl;
};

#endif // CONTROLLER_H
